package sketch.specs.values;

import java.util.List;

import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;

import sketch.generator.ValueGenerator;
import sketch.specs.DeclaredValueExtractor;
import sketch.util.Checker;

public abstract class AbstractValueDeclaration {
	
	public final SimpleName declaredName;
	public final VariableDeclarationFragment declaredFragment;
	public final List<Expression> expressions;
	
	public AbstractValueDeclaration(VariableDeclarationFragment fragment) {
		Checker.checkNull(fragment, "The variable declaration fragment should not be null.");
		this.declaredFragment = fragment;
		this.declaredName =fragment.getName();
		this.expressions = new DeclaredValueExtractor(fragment).getArgumentExpression();
	}
	
	public abstract ValueGenerator<Expression> getValueGenerator();
	
}
